from views.Aviews import userInfo,Authority,otherInfo
from views.Bviews import agency,plugin,marketing,commodity,childrenPlugin,wechatApi,childrenPlugin1
from views.Cviews import wx_userInfo,order
from views import upload
A_API = '/basic-api'
A_API_authority = '/basic-api/authority'
def url_router():
    Apublic = [
        # (userInfo.Alogin.as_view(), '/login/<id>')  # 获取路由参数
        (userInfo.A_Login.as_view(), A_API+'/login'), 
    ]
    Aauthority = [
        # 用户角色操作
        (userInfo.A_userInfo.as_view(),  A_API+'/person'),
        (userInfo.A_tree.as_view(),  A_API+'/tree'),
        (userInfo.A_source.as_view(),  A_API+'/source'),
        (userInfo.A_boutton.as_view(),  A_API+'/button'),
        (userInfo.A_role.as_view(),  A_API+'/roleList'),
        (userInfo.A_updateUserInfo.as_view(),  A_API+'/update_person'),
        (userInfo.A_userList.as_view(),  A_API+'/adminUserList'),
        (userInfo.A_userDel.as_view(),  A_API+'/adminUserDelete'),
        (userInfo.A_person_add.as_view(),  A_API+'/adminUserAdd'),
        (userInfo.adminUserUpdate.as_view(),  A_API+'/adminUserUpdate'),
        (userInfo.allocation_menus.as_view(),  A_API+'/allocation_menus'),
        (userInfo.dashboard.as_view(),  A_API+'/dashboard'),
        # 角色权限
        (Authority.addmemu.as_view(),  A_API_authority+'/addmemu'),
        (Authority.memulist.as_view(),  A_API_authority+'/menulist'),
        (Authority.memudel.as_view(),  A_API_authority+'/memudel'),
        (Authority.memuupdate.as_view(),  A_API_authority+'/memuupdate'),
        (Authority.rolelist.as_view(),  A_API+'/rolelist'),
        (Authority.roleadd.as_view(),  A_API+'/roleadd'),
        (Authority.roledel.as_view(),  A_API+'/roledel'),
        (Authority.roleedit.as_view(),  A_API+'/roleedit'),
        (Authority.allocation_users.as_view(),  A_API+'/allocation_users'),
        (Authority.operation_log.as_view(),  A_API+'/operation_log'),
        (Authority.error_log.as_view(),  A_API+'/error_log'),
        (Authority.distribution_menu.as_view(),  A_API+'/distribution_menu'),
    ]
    Aprivate = [
        (otherInfo.forbiddenWhite.as_view(), A_API + '/white'),
    ]

    Bauthority = [
        (agency.DashboardAgency.as_view(),  A_API+'/dashboard/agency'),

        (wechatApi.wechatList.as_view(), A_API + '/wechatApi/wechatList'),
        (wechatApi.wechatDelete.as_view(), A_API + '/wechatApi/wechatDelete'),

        (marketing.other_type_add.as_view(),  A_API+'/other_type/add'),
        (marketing.other_type_list.as_view(),  A_API+'/other_type/list'),
        (marketing.other_type_del.as_view(),  A_API+'/other_type/delete'),
        
        (commodity.typeAdd.as_view(),  A_API+'/commodity/category/add'),
        (commodity.typeEdit.as_view(),  A_API+'/commodity/category/edit'),
        (commodity.typeList.as_view(),  A_API+'/commodity/category/list'),
        (commodity.typeDelete.as_view(),  A_API+'/commodity/category/delete'),
        (commodity.goodsAdd.as_view(),  A_API+'/commodity/goods/add'),
        (commodity.goodsEdit.as_view(),  A_API+'/commodity/goods/edit'),
        (commodity.goodsList.as_view(),  A_API+'/commodity/goods/list'),
        (commodity.goodsDelete.as_view(),  A_API+'/commodity/goods/delete'),
        (commodity.businessAdd.as_view(),  A_API+'/commodity/business/add'),
        (commodity.businessList.as_view(),  A_API+'/commodity/business/list'),
        (commodity.businessDel.as_view(),  A_API+'/commodity/business/delete'),
        (commodity.businessEdit.as_view(),  A_API+'/commodity/business/edit'),
        (commodity.placeAnOrder.as_view(),  A_API+'/commodity/order/placeAnOrder'),
        (commodity.orderList.as_view(),  A_API+'/commodity/order/list'),
        (commodity.orderDel.as_view(),  A_API+'/commodity/order/delete'),

        (plugin.pluginAdd.as_view(), A_API + '/plugin/add'),
        (plugin.pluginList.as_view(), A_API + '/plugin/list'),
        (plugin.pluginDelete.as_view(), A_API + '/plugin/delete'),
        (plugin.pluginUpdate.as_view(), A_API + '/plugin/update'),
        (plugin.pluginMyPlugin.as_view(), A_API + '/plugin/myPlugin'),

        (childrenPlugin.themeAdd.as_view(), A_API + '/theme/update'),
        (childrenPlugin.themeList.as_view(), A_API + '/theme/list'),
        (childrenPlugin.main_activeList.as_view(), A_API + '/main_active/list'),
        (childrenPlugin.main_activeAdd.as_view(), A_API + '/main_active/add'),
        (childrenPlugin.main_activeDelete.as_view(), A_API + '/main_active/delete'),
        (childrenPlugin.main_activeUpdate.as_view(), A_API + '/main_active/update'),
        (childrenPlugin.bannerAdd.as_view(), A_API + '/banner/add'),
        (childrenPlugin.bannerList.as_view(), A_API + '/banner/list'),
        (childrenPlugin.bannerDelete.as_view(), A_API + '/banner/delete'),
        (childrenPlugin.bannerUpdate.as_view(), A_API + '/banner/update'),
        (childrenPlugin.noticeAdd.as_view(), A_API + '/notice/add'),
        (childrenPlugin.noticeList.as_view(), A_API + '/notice/list'),
        (childrenPlugin.noticeDelete.as_view(), A_API + '/notice/delete'),
        (childrenPlugin.noticeUpdate.as_view(), A_API + '/notice/update'),
        (childrenPlugin.rechargeshow.as_view(), A_API + '/rechargeshow/list'),
        (childrenPlugin.rechargeshowAdd.as_view(), A_API + '/rechargeshow/add'),
        (childrenPlugin.rechargeshowDelete.as_view(), A_API + '/rechargeshow/delete'),
        (childrenPlugin.rechargeshowUpdate.as_view(), A_API + '/rechargeshow/update'),
        (childrenPlugin.find_user.as_view(), A_API + '/rechargeshow/find_user'),
        (childrenPlugin.rechargerecord.as_view(), A_API + '/rechargerecord/recharge'),

        # 充值会员的列表
        (childrenPlugin.memberChargeAdd.as_view(), A_API + '/memberCharge/add'),
        (childrenPlugin.memberChargeList.as_view(), A_API + '/memberCharge/list'),
        (childrenPlugin.memberChargeDel.as_view(), A_API + '/memberCharge/delete'),
        (childrenPlugin.memberChargeUpdate.as_view(), A_API + '/memberCharge/update'),

        (childrenPlugin1.setMealAdd.as_view(), A_API + '/setMeal/add'),
        (childrenPlugin1.setMealList.as_view(), A_API + '/setMeal/list'),
        (childrenPlugin1.setMealDel.as_view(), A_API + '/setMeal/delete'),
        (childrenPlugin1.setMealUpdate.as_view(), A_API + '/setMeal/update'),


    ]

    Cpublic = [
        (wx_userInfo.wechatLogin.as_view(), A_API + '/wxlogin'),
        (order.xiaOrder.as_view(), A_API + '/wechatApi/order/createOrder'),
    ]

    public = [
        (upload.upload.as_view(), A_API + '/uploading'),
        (upload.filemanage_group_add.as_view(), A_API + '/filemanage_group_add'),
        (upload.filemanage_group_list.as_view(), A_API + '/filemanage_group_list'),
        (upload.filemanage_group_delete.as_view(), A_API + '/filemanage_group_delete'),
        (upload.get_file_manage.as_view(), A_API + '/getImage'),
        (upload.ImageDel.as_view(), A_API + '/ImageDel'),
    ]
    url_list = Apublic + Aauthority + Bauthority + Cpublic + public +Aprivate
    return url_list